#ifndef DATABASEDIALOG_H
#define DATABASEDIALOG_H

#include <QDialog>

namespace Ui {
    class DatabaseDialog;
}

class QDesignerWorkbench;
class DatabaseStorage;
//class DbTableModel;
//class DbColumnsModel;
//class QModelIndex;
//class AbstractContainer;

#include "dbcolumnsmodel.h"
#include "dbtablemodel.h"

#include "abstractcontainer.h"
#include <QModelIndex>

class DatabaseDialog : public QDialog
{
    Q_OBJECT

public:
    explicit DatabaseDialog(QWidget *parent = 0);
    ~DatabaseDialog();

    void done(int res);

private slots:
    void on_addButton_clicked();
    void on_removeButton_clicked();

    void on_addTable_clicked();

    void on_removeTable_clicked();

    void tableListRowChanged(QModelIndex,QModelIndex);

    void on_addColumn_clicked();

    void on_removeColumn_clicked();

    void on_dbTableWidget_currentCellChanged(int currentRow, int currentColumn, int previousRow, int previousColumn);

private:
    void populateDatabaseList();

    Ui::DatabaseDialog *ui;
    QDesignerWorkbench *m_workbench;
    AbstractContainer m_databases;

    DbColumnsModel *m_ColumnsModel;
    DbTableModel *m_TablesModel;

};

#endif // DATABASEDIALOG_H
